package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.IOtherOutStockDetailDao;
import com.erp.erp_entitys.warehouse.entity.OtherOutStockDetailEntity;
import com.erp.erp_entitys.warehouse.req.sellOutStockStatistics1Req;
import com.erp.erp_entitys.warehouse.rsp.OtherOutStockProductStatisticsRsp;
import com.erp.erp_servers.warehouse.IOtherOutStockDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : OtherOutStockDetailServiceImp
 * @Description : 其它出库明细实现类
 * @Author : lst
 * @Date: 2020-07-29 12:15
 */
@Service
public class OtherOutStockDetailServiceImp implements IOtherOutStockDetailService {

    /**
     * 其它出口明细接口
     */
    private final IOtherOutStockDetailDao otherOutStockDetailDao;

    @Autowired
    public OtherOutStockDetailServiceImp(IOtherOutStockDetailDao otherOutStockDetailDao) {
        this.otherOutStockDetailDao = otherOutStockDetailDao;
    }


    /**
     * 通过id查询
     * @param id 主键id
     * @return 其它出库明细对象
     */
    @Override
    public OtherOutStockDetailEntity queryById(Integer id) {
        return otherOutStockDetailDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param otherOutStockDetail 实例对象
     * @return 对象列表
     */
    @Override
    public List<OtherOutStockDetailEntity> queryAll(OtherOutStockDetailEntity otherOutStockDetail) {
        return otherOutStockDetailDao.queryAll(otherOutStockDetail);
    }

    /**
     * 新增数据
     *
     * @param otherOutStockDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(OtherOutStockDetailEntity otherOutStockDetail) {
        return otherOutStockDetailDao.insert(otherOutStockDetail);
    }

    /**
     * 其它出库详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<OtherOutStockDetailEntity> list) {
        return otherOutStockDetailDao.addList(list);
    }


    /**
     * 修改
     * @param detailEntity
     * @return
     */
    @Override
    public int update(OtherOutStockDetailEntity detailEntity) {
        return otherOutStockDetailDao.update(detailEntity);
    }

    /**
     * 其它出库产品统计
     * @param req 查询条件
     * @return 其它出库产品统计
     */
    @Override
    public List<OtherOutStockProductStatisticsRsp> statisticsProductInfo(sellOutStockStatistics1Req req) {
        return otherOutStockDetailDao.statisticsProductInfo(req);
    }
}
